module.exports = (req, res) => {

    let usernb = 1;
    req.all("/", (req, res) => {
        const fullURL = req.protocol + '://' + req.get('host') + req.originalUrl
        let pathurl = req.url;
        // console.log("有客户访问 访问路径:",pathurl,"完整地址:",fullURL);
        let dataout = {
            info: "输出总的数据包",
            total: 10,
            userNB: '0'+usernb,
            title:"客户端",
            data: [{
                name: "jeking",
                title: "goods1"

            }, {
                name: "jeking",
                title: "goods1"
            }, {
                name: "jeking",
                title: "goods1"
            }, {
                name: "jeking",
                title: "goods1"
            }]
        }
        usernb++;
        // console.log(dataout,dataout)
        res.render("../view/index", {
            data: dataout
        });

    });



    req.all("/user", (req, res) => {
        const fullURL = req.protocol + '://' + req.get('host') + req.originalUrl
        let pathurl = req.url;
        // console.log("有客户访问 访问路径:",pathurl,"完整地址:",fullURL);
        let dataout = {
            info: "输出总的数据包",
            total: 10,
            userNB: '0'+usernb,
            title:"客户端",
            data: [{
                name: "jeking",
                title: "goods1"
            }, {
                name: "jeking",
                title: "goods1"
            }, {
                name: "jeking",
                title: "goods1"
            }, {
                name: "jeking",
                title: "goods1"
            }]
        }

        // console.log(dataout,dataout[0].data[0].name)
        res.render("../view/index2", {
            data: dataout
        });
        usernb++;

    });




    req.all("/admin", (req, res) => {
        const fullURL = req.protocol + '://' + req.get('host') + req.originalUrl
        let pathurl = req.url;
        // console.log("有客户访问 访问路径:",pathurl,"完整地址:",fullURL);
        let dataout = {
            info: "输出总的数据包",
            total: 10,
            title:"管理端",
            data: [{
                name: "jeking",
                title: "goods1"
            }, {
                name: "jeking",
                title: "goods1"
            }, {
                name: "jeking",
                title: "goods1"
            }, {
                name: "jeking",
                title: "goods1"
            }]
        }

        // console.log(dataout,dataout[0].data[0].name)
        res.render("../view/admin", {
            data: dataout
        });

    });



}